#ifndef PATHPLANWIDGET_H
#define PATHPLANWIDGET_H

#include <QWidget>
#include <QPushButton>
#include "qrviz.hpp"
#include "node/rosnode.h"
#include "tools/cmdprocess.h"
#include "node/maptransformer.h"
#include "tools/map_file_manager.h"


class PathPlanWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PathPlanWidget(QWidget *parent = nullptr);
    ~PathPlanWidget();

signals:

private:
    void setupUI();

    void createConnect();

protected slots:

    void onBtnSend();
    void onBtnOpen();
    void onPoseSelectState(RosNode::PoseSelect errcode, int robotIndex);
    void onBack2Zero();
    void onUpdateMarker();
    void onSave();
    void onOpenPathBag();

private:

    QRviz * m_rviz;

    RosNode *m_node;//ros节点 订阅map地图


    QPushButton *m_btnSend;

    QPushButton *m_btnOpenFile;
    QPushButton *m_btnSave;
    QPushButton *m_btnOpenRogBag;

    QPushButton *m_btnBack2Zero;

    cmdProcess *m_process;
    cmdProcess *m_processPath;
    QString m_curfileName;

    QTimer *m_pubMarkerTimer;
    vector<int> m_prePathIndex;
    std::vector<nav_msgs::Path> m_pathResult;

    MapTransformer *m_mapTrans = nullptr;
    ros_map_edit::MapFileManager *m_mapFileManger =nullptr;
};

#endif // PATHPLANWIDGET_H
